home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD Exchange
/
CD Exchange - Volume 1.iso
/
graphics
/
utils
/
videotracker
/
develop
/
source
/
object.s
< prev
next >
Wrap
Text File
|
1993-08-09
|
44KB
|
2,292 lines
rout ;when this is off, the routine-file will be
;assembled, on=testing
;debug ;when this is on, colors in the background will
;show how much time the routine needs.
routinemode equ 14431 ;the routinemode !
; the first part of the source handles the things that are necessary to
; show the picture/copper and playing of the routine.
; the part between the "***" lines is the routine-source.
; at the bottom of the file, there are the necessary incbin-files who
; are needed to test the routine.
; these are saved with "save effect" in videotracker. they are raw
; data files which can be fonts,pictures,landscapes,vectorobjects
; etcetra.
; the incbin-files are put in the "variables" table, in the routine-
; player-handler
; the place where it's done can be found by searching for "!!!"
opt a+ ;devpac 3 optimize
opt o+
ifd rout
;videotracker routine-test
incdir "videotracker:include/"
include "exec/types.i"
include "graphics/gfxbase.i"
include "lvo/graphics_lib.i"
incdir 'videotracker:effect/'
vew_wid equ 44
vew_hgt equ 290
win_hgt equ 117
win_str equ $1a
SECTION 1,CODE_C
tus
lea var,a0 ;communication-table
move.l #rotincobj,var_obj1(a0) ;incbinfile !!!
move.l #rotincbck,var_bck(a0) ;incbinfile !!!
move.l ($4).w,a6
sub.l a1,a1
jsr -$126(a6) ;findtask
move.l d0,curtsk
move.l d0,a0
move.l $b8(a0),tskpri
lea dosnam,a1 ;doslib openen
moveq.l #0,d0
move.l (4).w,a6
jsr -408(a6) ;openlib
move.l d0,doslib
bsr.s label5 ;videotracker opstarten
move.l curtsk,a0
move.l tskpri,$b8(a0)
move.l ($4).w,a6
jsr -$84(a6) ;forbid
move.l doslib,a1
move.l (4).w,a6
jsr -414(a6) ;closelib
moveq.l #0,d0
rts
label5
move.l (4).w,a6 ;workbench gedoe
move.b 530(a6),ntscmode ;50/60 hertz halen
cmp.b #50,ntscmode ;ntsc ?
beq.s str.ntsc
move.l #vew_hgt-56,hogscr ;set NTSC screen hight
str.ntsc
move.l (4).w,a6 ;68030 cache off
jsr -120(a6)
btst.b #1,297(a6)
beq.s str.nfc
lea.l str.ft,a5
jsr -30(a6)
str.nfc
jsr -126(a6)
bra.s str.fc
str.ft
dc.w $4e7a,2
bclr #0,d0
bset #13,d0
dc.w $4e7b,2
rte
str.fc
lea cprjmp,a2 ;copjmp zetten !
move.l #cprbck-8,d0
move.w d0,6(a2)
swap d0
move.w d0,2(a2)
lea cprbck-8,a2 ;copstr zetten !
move.l #cpr,d0
move.w d0,6(a2)
swap d0
move.w d0,2(a2)
bsr cprsprrem ;sprites legen
lea gfxnam,a1 ;graphics lib openen
move.l (4).w,a6
jsr -408(a6) ;openlib
move.l d0,a6
move.l d0,gfxlib
move.l 38(a6),oldcprlist
bset #1,$bfe001
bsr copbuf ;copper vullen
bsr sysoff
gadrun
btst #6,($bfe001).l
bne gadrun
scrend
scrend.play
bsr syson
move.l gfxlib,a1
move.l (4).w,a6
jsr -414(a6) ;closelib
scrend.qb
moveq.l #0,d0
rts
;vertical blank interrupt, no blits.
;handles counters,interlace,sprite
;level 3
intvb
bra.s intvb.cnt
dc.l 'VIDU'
dc.l 'LOOP'
intvb.cnt
movem.l d0-d7/a0-a6,-(sp)
lea ($dff000).l,a6
move.w $01e(a6),d0
btst #5,d0 ;vblank ?
bne.s intvb.vb
bra.s intcop.end
intvb.vb
bsr grap
bsr palctr ;palette zetten
bsr.s copbuf ;copper vullen
intvb.end
move.w #$0020,$09c(a6) ;vb bit wissen
movem.l (sp)+,d0-d7/a0-a6 ;multitask uit, shit !
rte
intcop.end
movem.l (sp)+,d0-d7/a0-a6
move.l intvbold,-(sp)
rts
;transmission buffer empty routine, BLIT !
;handles routines,animations
inttbe ;tbe interrupt
movem.l d0-d7/a0-a6,-(sp)
lea ($dff000).l,a6
move.w $01e(a6),d0
btst #0,d0 ;no tbe ?
beq.s intdskblk
btst #6,($bfe001).l ;muis ingedrukt ?
beq.s inttbe.cop
btst #2,($dff016).l
beq.s inttbe.cop
ifd debug
move.w #$700,$dff180
endc
bsr rotply ;routineplayer BLIT !
bsr.s copbuf ;copper vullen
ifd debug
move.w #$070,$dff180
endc
inttbe.cop
inttbe.end
move.w #$0001,$09c(a6)
movem.l (sp)+,d0-d7/a0-a6
rte
intdskblk
move.w #$0001,$09c(a6) ;be sure for no tbe handling
movem.l (sp)+,d0-d7/a0-a6
move.l inttbeold,-(sp)
rts
;moves the copperbuffer to the copperlist
;sort of double buffering
copbuf
movem.l d0-d7/a0-a6,-(sp)
lea ($dff000).l,a6
copbuf.novb ;copperchange overslaan
moveq.l #0,d0
move.b $005(a6),d0
lsl.w #8,d0
moveq.l #0,d1
move.b $006(a6),d1
add.w d1,d0
cmp.w #$4,d0
blt copbuf.novb
cmp.b #50,ntscmode
beq.s copbuf.pal
cmp.w #$133-56-8,d0 ;ntsc grens
bge copbuf.novb
bra.s copbuf.cont
copbuf.pal
cmp.w #$133-8,d0 ;pal grens
bge copbuf.novb
copbuf.cont
lea gra.s,a0 ;buffer copieren
lea cprbuf,a1
move.w 00*4+2(a0),00*4+2(a1)
move.w 01*4+2(a0),01*4+2(a1)
move.w 02*4+2(a0),02*4+2(a1)
move.w 03*4+2(a0),03*4+2(a1)
move.w 04*4+2(a0),04*4+2(a1)
move.w 05*4+2(a0),05*4+2(a1)
move.w 06*4+2(a0),06*4+2(a1)
move.w 07*4+2(a0),07*4+2(a1)
move.w 08*4+2(a0),08*4+2(a1)
move.w 09*4+2(a0),09*4+2(a1)
move.w 10*4+2(a0),10*4+2(a1)
move.w 11*4+2(a0),11*4+2(a1)
move.w 12*4+2(a0),12*4+2(a1)
move.w 13*4+2(a0),13*4+2(a1)
move.w 14*4+2(a0),14*4+2(a1)
move.w 15*4+2(a0),15*4+2(a1)
move.w 16*4+2(a0),16*4+2(a1)
move.w 17*4+2(a0),17*4+2(a1)
move.w 18*4+2(a0),18*4+2(a1)
move.w 19*4+2(a0),19*4+2(a1)
move.w 20*4+2(a0),20*4+2(a1)
move.w 21*4+2(a0),21*4+2(a1)
move.w 22*4+2(a0),22*4+2(a1)
move.w 23*4+2(a0),23*4+2(a1)
move.w 24*4+2(a0),24*4+2(a1)
move.w 25*4+2(a0),25*4+2(a1)
move.w 26*4+2(a0),26*4+2(a1)
move.w 27*4+2(a0),27*4+2(a1)
move.w 28*4+2(a0),28*4+2(a1)
move.w 29*4+2(a0),29*4+2(a1)
move.w 30*4+2(a0),30*4+2(a1)
move.w 31*4+2(a0),31*4+2(a1)
move.w 32*4+2(a0),32*4+2(a1)
move.w 33*4+2(a0),33*4+2(a1)
move.w 34*4+2(a0),34*4+2(a1)
move.w 35*4+2(a0),35*4+2(a1)
move.w 36*4+2(a0),36*4+2(a1)
move.w 37*4+2(a0),37*4+2(a1)
move.w 38*4+2(a0),38*4+2(a1)
move.w 39*4+2(a0),39*4+2(a1)
move.w 40*4+2(a0),40*4+2(a1)
move.w 41*4+2(a0),41*4+2(a1)
move.w 42*4+2(a0),42*4+2(a1)
move.w 43*4+2(a0),43*4+2(a1)
move.w 44*4+2(a0),44*4+2(a1)
move.w 45*4+2(a0),45*4+2(a1)
move.w 46*4+2(a0),46*4+2(a1)
move.w 47*4+2(a0),47*4+2(a1)
move.w 48*4+2(a0),48*4+2(a1)
move.w 49*4+2(a0),49*4+2(a1)
move.w 50*4+2(a0),50*4+2(a1)
move.w 51*4+2(a0),51*4+2(a1)
move.w 52*4+2(a0),52*4+2(a1)
move.w 53*4+2(a0),53*4+2(a1)
move.w 54*4+2(a0),54*4+2(a1)
copbuf.end
movem.l (sp)+,d0-d7/a0-a6
rts
;goes back to the workbench
syson
movem.l d0-d7/a0-a6,-(sp)
move.w #$0001,$dff09a ;tbeint uit
move.l intvbold,($6c).w
move.l inttbeold,($64).w
move.l 4,a6
jsr -138(a6) ;permit
move.l gfxlib,a6
jsr -462(a6) ;disownblitter
move.l wbview,a1
move.l gfxlib,a6
jsr _LVOLoadView(a6) ; Fix view
jsr _LVOWaitTOF(a6)
jsr _LVOWaitTOF(a6) ; wait for LoadView()
syson.ras
cmp.b #$c0,$dff006 ;prevent copperjump
bne syson.ras
move.l gfxlib,a6
move.l gb_copinit(a6),$dff080 ; Kick it into life
movem.l (sp)+,d0-d7/a0-a6
rts
;goes back to the gadgetscreen
sysoff
movem.l d0-d7/a0-a6,-(sp)
move.l gfxlib,a6
move.l gb_ActiView(a6),wbview ;current view
sub.l a1,a1 ; clear a1
jsr _LVOLoadView(a6) ; Flush View to nothing
jsr _LVOWaitTOF(a6) ; Wait once
jsr _LVOWaitTOF(a6) ; Wait again.
move.l gfxlib,a6
jsr -456(a6) ;ownblitter
move.l 4,a6
jsr -132(a6) ;forbid
move.l ($6c).w,intvbold
move.l #intvb,($6c).w
move.l ($64).w,inttbeold
move.l #inttbe,($64).w
move.w #$8001,$dff09a ;tbeint aan
bsr gracpr ;reset copper
bsr copbuf ;copy copper
move.l #cpr,$dff080
movem.l (sp)+,d0-d7/a0-a6
rts
cprsprrem
movem.l d0-d7/a0-a6,-(sp)
lea cprspr,a0
move.l #sprdat,d0
move.w #7,d1
cprsprrem.a
move.w d0,3*2(a0)
swap d0
move.w d0,1*2(a0)
swap d0
add.l #8,a0
dbra d1,cprsprrem.a
movem.l (sp)+,d0-d7/a0-a6
rts
varset ;variablen neerzetten
movem.l d0-d7/a0-a6,-(sp)
move.l #var,a0
move.l #cprbck,var_cprbck(a0)
move.l gfxlib,var__GfxBase(a0)
move.b ntscmode,var_ntsc(a0)
move.l curpic1,var_pic1(a0) ;variabel
move.l curpic2,var_pic2(a0) ;variabel
move.w anispd1,var_anispd1(a0)
move.w anitel1,var_anitel1(a0)
movem.l (sp)+,d0-d7/a0-a6
rts
;this routine handles all videotracker-routines
rotply
movem.l d0-d7/a0-a6,-(sp)
moveq.l #0,d0
lea currot1,a2 ;routine 1
move.w rotinf1,d0 ;routine info
bsr.s rotplyr
rotply.end
movem.l (sp)+,d0-d7/a0-a6
rts
;this routine handles 1 routine, BLIT !
rotplyr
movem.l d0-d7/a1-a6,-(sp)
move.l #rot,(a2) ;routinestart address
move.b #50,ntscmod